<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('新增鸡入库')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-ncInputChicken-add">
		<!--	<div class="form-group">
				<label class="col-sm-3 control-label">入栏批次：</label>
				<div class="col-sm-8">
					<input id="inputCode" name="inputCode" class="form-control" type="text">
				</div>
			</div>-->
			<input type="hidden" id="inputStatus" name="inputStatus" value="1"/>
			<div class="form-group">	
				<label class="col-sm-3 control-label">入栏鸡品种：</label>
				<div class="col-sm-8">
					<select name="inputVarieties" required class="form-control m-b" th:with="type=${@dict.getType('chicken_type')}">
						<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
					</select>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">供应商：</label>
				<div class="col-sm-8">
					<input id="supplier" name="supplier" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">检疫合格证（有/无）：</label>
				<div class="col-sm-8">
					<select name="isHege" required class="form-control m-b" th:with="type=${@dict.getType('chickenIsHege')}">
						<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
					</select>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">数量（只)：</label>
				<div class="col-sm-8">
					<input id="inputAmount" name="inputAmount" class="form-control" required type="number" onkeyup=" value=value.replace(/^(0+)|[^\d]+/g,'')">
					<input id="stackAmount" th:type="hidden" name="stackAmount" class="form-control" type="number" onkeyup=" value=value.replace(/^(0+)|[^\d]+/g,'')">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">入栏时间：</label>
				<div class="col-sm-8">
					<input type="text" style="height: 34px;" data-format="yyyy-MM-dd HH:mm:ss"  th:value="*{#dates.format(new java.util.Date().getTime(), 'yyyy-MM-dd HH:mm:ss')}" name="inputTime" data-type="datetime" class="time-input" id="inputTime"/>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">入栏经手人：</label>
				<div class="col-sm-8">
					<input id="inputUser" name="inputUser" class="form-control" type="text" th:value="${user}">
				</div>
			</div>
			<!--<div class="form-group">
				<label class="col-sm-3 control-label">创建者：</label>
				<div class="col-sm-8">
					<input id="createBy" name="createBy" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">创建时间：</label>
				<div class="col-sm-8">
					<input id="createTime" name="createTime" class="form-control" type="text">
				</div>
			</div>-->
			<div class="form-group">	
				<label class="col-sm-3 control-label">备注：</label>
				<div class="col-sm-8">
					<textarea id="remark" name="remark"  class="form-control valid" type="text" rows="4"></textarea>
				</div>
			</div>
		</form>
	</div>
    <div th:include="include::footer"></div>
    <script type="text/javascript">

		var prefix = ctx + "system/ncInputChicken"
		$("#form-ncInputChicken-add").validate({
			rules:{
				xxxx:{
					required:true,
				},
			},
			focusCleanup: true
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
                $("#stackAmount").val($("#inputAmount").val());
	            $.operate.save(prefix + "/add", $('#form-ncInputChicken-add').serialize());
	        }
	    }
	</script>
</body>
</html>
